package cn.anecansaitin.whimsy.common.register;

import cn.anecansaitin.whimsy.Whimsy;
import cn.anecansaitin.whimsy.common.effect.SimpleEffect;
import cn.anecansaitin.whimsy.common.effect.ow.doomfist.*;
import cn.anecansaitin.whimsy.common.effect.ow.Slowdown;
import cn.anecansaitin.whimsy.common.effect.ow.Stun;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.neoforged.neoforge.common.NeoForgeMod;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;

public class ModEffects {
    public static final DeferredRegister<MobEffect> EFFECTS = DeferredRegister.create(Registries.MOB_EFFECT, Whimsy.MODID);

    public static final DeferredHolder<MobEffect, MobEffect> EARTHQUAKE = EFFECTS.register("earthquake", () -> new SimpleEffect(MobEffectCategory.HARMFUL, 0).addAttributeModifier(Attributes.MOVEMENT_SPEED, "9158DE49-F738-C845-AFF7-20CE5D5907C4", -0.3, AttributeModifier.Operation.MULTIPLY_TOTAL));
    public static final DeferredHolder<MobEffect, MobEffect> STUN = EFFECTS.register("stun", () -> new Stun()
            .addAttributeModifier(Attributes.MOVEMENT_SPEED, "328A6B88-E751-C529-4189-4E31AA7BF122", -1, AttributeModifier.Operation.MULTIPLY_TOTAL)
            .addAttributeModifier(Attributes.ATTACK_SPEED, "1BA4F82F-1189-A0D2-F58F-F32CD49C8044", -1, AttributeModifier.Operation.MULTIPLY_TOTAL)
            .addAttributeModifier(Attributes.FLYING_SPEED, "44A351B4-0801-D1D0-84F8-61DDF52066B2", -1, AttributeModifier.Operation.MULTIPLY_TOTAL));
    public static final DeferredHolder<MobEffect, MobEffect> ROCKET_PUNCH = EFFECTS.register("rocket_punch", () -> new RocketPunch()
            .addAttributeModifier(NeoForgeMod.STEP_HEIGHT.value(), "AD3A0EC1-E3AB-EE46-D11A-1CB89B48143B", 0.5, AttributeModifier.Operation.ADDITION));
    public static final DeferredHolder<MobEffect, MobEffect> ROCKET_PUNCH_CHARGING = EFFECTS.register("rocket_punch_charging", () -> new RocketPunchCharging()
            .addAttributeModifier(Attributes.MOVEMENT_SPEED, "A4D08A13-B526-6BF3-395B-0CBB496D4D0D", -0.5, AttributeModifier.Operation.MULTIPLY_TOTAL));
    public static final DeferredHolder<MobEffect, MobEffect> IMPACT = EFFECTS.register("impact", Impact::new);
    public static final DeferredHolder<MobEffect, MobEffect> SEISMIC_SLAM = EFFECTS.register("seismic_slam", SeismicSlam::new);
    public static final DeferredHolder<MobEffect, MobEffect> SLOWDOWN = EFFECTS.register("slowdown", () -> new Slowdown()
            .addAttributeModifier(Attributes.MOVEMENT_SPEED, "351EA264-22BC-C6E5-BE9F-F5DDA3C49411", -0.01, AttributeModifier.Operation.MULTIPLY_TOTAL));
    public static final DeferredHolder<MobEffect, MobEffect> POWER_BLOCK = EFFECTS.register("power_block", () -> new PowerBlock()
            .addAttributeModifier(Attributes.MOVEMENT_SPEED, "ACD83C7A-0E5A-2B87-78A8-9E3C93C1F55B", -0.35, AttributeModifier.Operation.MULTIPLY_TOTAL));
    public static final DeferredHolder<MobEffect, MobEffect> METEOR_STRIKE = EFFECTS.register("meteor_strike", () -> new MeteorStrike()
            .addAttributeModifier(Attributes.MOVEMENT_SPEED, "0694B3B3-9BDE-A7F5-2882-315C4017587D", 0.05, AttributeModifier.Operation.ADDITION));
}
